home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/stdio/c/RCS/putw,v $
- * $Date: 1996/04/19 21:32:42 $
- * $Revision: 1.1 $
- * $State: Rel $
- * $Author: simon $
- *
- * $Log: putw,v $
- * Revision 1.1 1996/04/19 21:32:42 simon
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: putw,v 1.1 1996/04/19 21:32:42 simon Rel $";
-
- #include <stdio.h>
-
- #define INTSIZE 4
-
- __STDIOLIB__
-
- int
- putw (register int i, register FILE * f)
- {
- putc (i & 0xff, f);
- putc ((i >> 8) & 0xff, f);
- #if INTSIZE > 2
- putc ((i >> 16) & 0xff, f);
- putc ((i >> 24) & 0xff, f);
- #if INTSIZE > 4
- putc ((i >> 32) & 0xff, f);
- putc ((i >> 40) & 0xff, f);
- putc ((i >> 48) & 0xff, f);
- putc ((i >> 56) & 0xff, f);
- #endif
- #endif
- return (ferror (f) ? -1 : i);
- }
-